/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "OFFICE_ITEMS")
public class OfficeItems extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "办公用品";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_MC = "名称";
	public static final String ALIAS_XH = "型号";
	public static final String ALIAS_GG = "规格";
	public static final String ALIAS_SL = "数量";
	public static final String ALIAS_DW = "单位";
	public static final String ALIAS_LB = "类别";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 名称       db_column: MC 
     */ 	
	@Length(max=60)
	private java.lang.String mc;
    /**
     * 型号       db_column: XH 
     */ 	
	@Length(max=60)
	private java.lang.String xh;
    /**
     * 规格       db_column: GG 
     */ 	
	@Length(max=50)
	private java.lang.String gg;
    /**
     * 数量       db_column: SL 
     */ 	
	
	private Long sl;
    /**
     * 单位       db_column: DW 
     */ 	
	@Length(max=10)
	private java.lang.String dw;
    /**
     * 类别       db_column: LB 
     */ 	
	
	private Long lb;
	//columns END


	public OfficeItems(){
	}

	public OfficeItems(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "MC", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getMc() {
		return this.mc;
	}
	
	public void setMc(java.lang.String value) {
		this.mc = value;
	}
	
	@Column(name = "XH", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getXh() {
		return this.xh;
	}
	
	public void setXh(java.lang.String value) {
		this.xh = value;
	}
	
	@Column(name = "GG", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getGg() {
		return this.gg;
	}
	
	public void setGg(java.lang.String value) {
		this.gg = value;
	}
	
	@Column(name = "SL", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getSl() {
		return this.sl;
	}
	
	public void setSl(Long value) {
		this.sl = value;
	}
	
	@Column(name = "DW", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.String getDw() {
		return this.dw;
	}
	
	public void setDw(java.lang.String value) {
		this.dw = value;
	}
	
	@Column(name = "LB", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getLb() {
		return this.lb;
	}
	
	public void setLb(Long value) {
		this.lb = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Mc",getMc())
			.append("Xh",getXh())
			.append("Gg",getGg())
			.append("Sl",getSl())
			.append("Dw",getDw())
			.append("Lb",getLb())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OfficeItems == false) return false;
		if(this == obj) return true;
		OfficeItems other = (OfficeItems)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	private String dataname;

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}
}

